package com.example.listener;

import com.example.event.GenericEvent;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class AsyncEventListener {

    @Async
    @EventListener
    public void handleEvent(GenericEvent<String> event) {
        // 异步处理事件
        System.out.println("异步处理事件");
    }
}